<?php
class email {
	private $smtpserver = "smtp.163.com";//SMTP服务器
	private $smtpserverport =25;//SMTP服务器端口
	private $smtpusermail = "zadffcom@163.com";//SMTP服务器的用户邮箱
	private $smtpuser = "zadffcom";//SMTP服务器的用户帐号
	private $smtppass = "zadff.com163";//SMTP服务器的用户密码
	private $mailtype = "HTML";//邮件格式（HTML/TXT）,TXT为文本邮件
	private $smtpemailto;
	private $mailtitle;
	private $mailcontent;

	public function __construct($smtpemailto,$mailtitle,$mailcontent){
		$this->smtpemailto = $smtpemailto;
		$this->mailtitle = $mailtitle;
		$this->mailcontent = $mailcontent;
	}
	public function sendemail() {
		include_once 'smtp.php';
		$smtp = new smtp($this->smtpserver,$this->smtpserverport,true,$this->smtpuser,$this->smtppass);//
		$smtp->debug = false;//是否显示发送的调试信息
		$state = $smtp->sendmail($this->smtpemailto, $this->smtpusermail, $this->mailtitle, $this->mailcontent, $this->mailtype);
		if ($state) {
			return true;
		}else {
			return false;
		}
	}
}